<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="org.springframework.security.core.context.SecurityContextHolder" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>

<c:url var="css" value="/resources/css" /> 
<c:url var="menu" value="../../menu.jsp" /> 
<c:url var="modify" value="/admin/batiment/modify" />
<c:url var="view" value="/admin/batiment/view" />
<c:url var="add" value="/admin/batiment/add" />

<html>
<head>
	<link rel="stylesheet" type="text/css" media="screen" href="${css}/style.css"/>
	<title>Admin</title>
</head>

<body>
	<jsp:include page="${menu}" />
	<h1 id="banner">Admin - Batiments</h1>
	<hr/>
	
	<a href="${view}">Retour</a>
	
		<form class="form" action="${add}" method="POST" >
		<fieldset>
			<legend>Ajout</legend>
			
			<p>
			<label for="name">Name</label>:
			<input id="name" name="name" size="20" maxlength="20" type="text" />
			<form:errors path="name" cssClass="error" />
			</p>
			
			<p>
			<label for="level">Level</label>:
			<input id="level" name="level" size="20" maxlength="20" type="text" />
			<form:errors path="level" cssClass="error" />
			</p>
			
			<p>
			<label for="costResources1">costResources1</label>:
			<input id="costResources1" name="costResources1" size="20" maxlength="20" type="text" />
			<form:errors path="costResources1" cssClass="error" />
			</p>
		
			<p>
			<label for="costResources2">costResources2</label>:
			<input id="costResources2" name="costResources2" size="20" maxlength="20" type="text" />
			<form:errors path="costResources2" cssClass="error" />
			
			</p>
		
			<p>
			<label for="costResources3">costResources3</label>:
			<input id="costResources3" name="costResources3" size="20" maxlength="20" type="text" />
			<form:errors path="costResources3" cssClass="error" />
			</p>
		
			<p>
			<label for="costResources4">costResources4</label>:
			<input id="costResources4" name="costResources4" size="20" maxlength="20" type="text" />
			<form:errors path="costResources4" cssClass="error" />
			</p>
			
			<p>
			<label for="interestResources1">interestResources1</label>:
			<input id="interestResources1" name="interestResources1" size="20" maxlength="20" type="text" />
			<form:errors path="interestResources1" cssClass="error" />
			</p>
			
			<p>
			<label for="interestResources2">interestResources2</label>:
			<input id="interestResources2" name="interestResources2" size="20" maxlength="20" type="text" />
			<form:errors path="interestResources2" cssClass="error" />
			</p>
			
			<p>
			<label for="interestResources3">interestResources3</label>:
			<input id="interestResources3" name="interestResources3" size="20" maxlength="20" type="text" />
			<form:errors path="interestResources3" cssClass="error" />
			</p>
			
			<p>
			<label for="interestResources4">interestResources4</label>:
			<input id="interestResources4" name="interestResources4" size="20" maxlength="20" type="text" />
			<form:errors path="interestResources4" cssClass="error" />
			</p>
			
			<p>
			<label for="batimentReq">BatimentReq</label>:
			<select name="batimentReq" multiple="multiple">
				<c:forEach items="${batiments}" var="batiment">
					<option value="${batiment.name}">${batiment.name} - Lv ${batiment.lvl}</option>
				</c:forEach>
			</select>
			</p>
			
			<p>
			<label for="technologieReq">TechnologieReq</label>:
			<select name="technologieReq" multiple="multiple">
				<c:forEach items="${technologies}" var="technologie">
					<option value="${technologie.name}">${technologie.name} - Lv ${technologie.lvl}</option>
				</c:forEach>
			</select>
			</p>
			
			<p><input type="submit" value="Ajouter"/></p>
		</fieldset>
	</form>
	<p class="message">${message}</p>
</body>
</html>